<?php
/**
 * 楼层品牌类型管理
 * @author Ice iceinto@mallog.com.cn
 */
class FloorBrandTypeModel extends BaseModel
{
    /**
     * 执行添加
     * @param Array $data 数据
     * @author Ice iceinto@mallog.com.cn
     */
    public function fbtAdd ($data)
    {
        //唯一性判断
        $this->theOnly($data['name'], 'name', '名称', true, 
        array('mid' => $data['mid'], 'fid' => $data['fid']), 'eq');
        if ($this->status['status']) {
            if ($this->add($data)) {
                $this->status['status'] = 1;
                $this->status['doc'] = '添加成功！';
            } else {
                $this->status['doc'] = '添加失败！';
            }
        }
        return $this->status;
    }
    /**
     * 执行修改
     * @param Array $data 数据
     * @author Ice iceinto@mallog.com.cn
     */
    public function fbtUpdate ($data)
    {
        //唯一性判断
        $this->theOnly($data['name'], 'name', '名称', true, 
        array('mid' => $data['mid'], 'fid' => $data['fid']), 'eq');
        if ($this->status['status']) {
            if ($this->save($data)) {
                $this->status['status'] = 1;
                $this->status['doc'] = '添加成功！';
            } else {
                $this->status['doc'] = '添加失败！';
            }
        }
        return $this->status;
    }
}
?>